<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>作业1：买可乐</title>
</head>

<body>
    <script>
        var money = 20;
        var price = 3;
        var count = 0;
        while (money >= price) {
            var n = parseInt(money / price);
            count += n;
            var yuer = money % price;
            money = yuer + n;
        }
        console.log("20元可以买" + count + "瓶可乐")

    </script>
</body>

</html>